<script>
import axios from "axios";

export default {
  name: "Coming",
  data() {
    return {
      films: []
    };
  },
  created() {
    axios.get("https://m.maizuo.com/gateway?cityId=110100&pageNum=1&pageSize=10&type=2&k=3846586", {
      headers: {
        "x-client-info": "{\"a\":\"3000\",\"ch\":\"1002\",\"v\":\"5.2.1\",\"e\":\"1762677139773283091841025\",\"bc\":\"110100\"}",
        "x-host": "mall.film-ticket.film.list",
      }
    }).then((value) => {
      this.films = value.data.data.films;
      // console.log(this.films);
    }).catch(err => {
      console.error("请求失败：", err);
    });
  }
};
</script>

<template>
  <div>
    <p v-for="item in films" :key="item.filmId">
      <router-link :to="{path:'/ing',query:{filmId:item.filmId}}">
        {{ item.name }}
        <br>
        <img :src=item.poster style="width: 300px">
      </router-link>
    </p>

  </div>
</template>

<style scoped lang="less">
</style>